package com.zjyd.douyangsearch.mode;

import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

/**
 * 一个类就是一个索引 = 一个数据库
 */
@Data
@IndexName(value="xl_goods_index")
public class GoodsEs {

    //IdType.CUSTOMIZE 才是用户自定义
    @IndexId(type= IdType.CUSTOMIZE)
    private String id;

    /**
     * 商品名称
     * IK_SMART 分词器（智能分词）
     */
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String goodsName;

    @IndexField
    private double price;

    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private String time;

}
